class Animal {
    name: string;
    constructor(name: string) {
        this.name = name;
    }
    eat() {
        //具体吃什么不知道，具体吃什 么?继承它的子类去实现，每一个子类的表现不一- 样
        console.log('吃的方法')
    }
}
/*子类Dog*/
class Dog extends Animal {
    constructor(name: string) {
        super(name);
    }
    eat() {
        return this.name + '吃肉骨头';
    }
}
/*子类Cat*/
class Cat extends Animal {
    constructor(name: string) {
        super(name)
    }
    eat() {
        return this.name + '吃鱼'
    }
}
